package com.mmall.concurrency.immutable;

import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**  基本变量和引用变量编译报错
 *   引用变量不可以再指向， 但是可以修改里面的值
 */
@Slf4j
public class UnmodifyVarible {

    public static final int a = 1;
    public static final String b = "2";
    public static final Map<Integer, Integer> map = Maps.newHashMap();

    static {
        map.put(1,2);
        map.put(2,5);
        map.put(3,6);
    }

    public static void main(String[] args) {
//        a = 2;
//        b = "fuck!";
//        map = new Maps.newHashMap();
//        map.put("b", "fuck!");
        map.put(1, 10100111);
        log.info("修改成功：{}", map.get(1));
    }

    private void test(final int a){
        // a = 1;
    }
}
